<#include "/public/macro.html">
<div class="uk-layui-form">
	<form class="layui-form uk-form" action="/admin/metadata/properties/update.html">
		<input type="hidden" name="id" value="${tp.id!''}">
		<div class="layui-form-item">
			<label class="layui-form-label">标题：</label>
			<div class="layui-input-inline">
				<input type="text" name="name" value="${tp.name!''}"
					required lay-verify="required" placeholder="标题"
					autocomplete="off" class="layui-input">
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">顺序：</label>
			<div class="layui-input-inline" style="width:80px;" title="顺序">
				<select name="sortindex">
					<#list 1..100 as inx>
					<option value="${inx}" <#if tp.sortindex?? && tp.sortindex == inx>selected="selected"</#if>>${inx}</option>
					</#list>
				</select>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">禁用导入导出：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="impfield" lay-skin="switch" value="1" <#if tp.impfield == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width:100px;">生成ID：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="pk" lay-skin="switch" value="1" <#if tp.pk == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">电话号码：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="phonenumber" lay-skin="switch" lay-filter="phonenum" value="1" <#if tp.phonenumber?? && tp.phonenumber == true>checked="checked"</#if> lay-text="是|否">
				</div>
			</div>
			<div class="layui-inline" id="phontype_sel" style="<#if tp.phonenumber?? && tp.phonenumber == true><#else>display:none;</#if>">
				<label class="layui-form-label" style="width:100px;">号码类型：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<@select "com.dic.phone.type" "phonetype" tp.phonetype!'' "lay-ignore"/>
				</div>
			</div>
		</div>
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">启用字典：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="seldata" lay-filter="dic" lay-skin="switch" value="1" <#if tp.seldata == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline"  id="sysdicsel" style="<#if tp.seldata == false>display:none;</#if>">
				<label class="layui-form-label" style="width:60px;">字典项：</label>
				<div class="layui-input-inline">
					<select name="seldatacode" lay-ignore style="width:220px;">
						<option value="">请选择字典项</option>
						<#if sysdicList??>
						<#list sysdicList as sysDic>
						<option value="${sysDic.code!''}" <#if tp.seldatacode?? && tp.seldatacode == sysDic.code>selected="selected"</#if>>${sysDic.name}</option>
						</#list>
						</#if>
					</select>
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">启用关联：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="reffk" lay-filter="fk" lay-skin="switch" value="1" <#if tp.reffk == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline"  id="fk" style="<#if tp.reffk == false>display:none;</#if>">
				<label class="layui-form-label" style="width:60px;">关联项：</label>
				<div class="layui-input-inline">
					<select name="reftbid" style="width:220px;">
						<option value="">请选择关联接口</option>
						<#if dataImplList??>
						<#list dataImplList as datadic>
						<option value="${datadic.code!''}" <#if tp.reftbid?? && tp.reftbid == datadic.code>selected="selected"</#if>>${datadic.name}</option>
						</#list>
						</#if>
					</select>
				</div>
			</div>
		</div>
		
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">启用流程变量：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="systemfield" lay-skin="switch" value="1" <#if tp.systemfield == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
			<div class="layui-inline">
				<label class="layui-form-label" style="width:100px;">启用多值：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="modits" lay-skin="switch" value="1" <#if tp.modits == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
		</div>
		
		
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">数据校验：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:380px;margin-top:0px;">
					<input type="checkbox" name="defaultvaluetitle" title="非空" value="required" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("required") gte 0>checked</#if> lay-skin="primary">
					<input type="checkbox" name="defaultvaluetitle" title="数字" value="numstr" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("numstr") gte 0>checked</#if> lay-skin="primary"> 
					<input type="checkbox" name="defaultvaluetitle" title="日期" value="datenum" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("datenum") gte 0>checked</#if> lay-skin="primary">
					<input type="checkbox" name="defaultvaluetitle" title="日期时间" value="datetime" <#if tp.defaultvaluetitle?? && tp.defaultvaluetitle?index_of("datetime") gte 0>checked</#if> lay-skin="primary"> 
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">转日期：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;margin-top:0px;">
					 <input type="checkbox" name=defaultfieldvalue lay-skin="switch" value="date" <#if tp.defaultfieldvalue?? && tp.defaultfieldvalue == "date">checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>

			<div class="layui-inline">
				<label class="layui-form-label" style="width:100px;">JSON数据：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:80px;">
					<input type="checkbox" name="unresize" lay-skin="switch" value="1" <#if tp.unresize == true>checked="checked"</#if> lay-text="开启|关闭">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">数据处理：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:380px;">
					<input type="radio" name="plugin" value="" <#if tp.plugin?? && tp.plugin == "">checked="checked"</#if> title="无处理">
					 <input type="radio" name="plugin" value="sectime" <#if tp.plugin?? && tp.plugin == "sectime">checked="checked"</#if> title="秒转时间">
					 <input type="radio" name="plugin" value="mintime" <#if tp.plugin?? && tp.plugin == "mintime">checked="checked"</#if> title="毫秒转时间">
				</div>
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">显示位置：</label>
				<div class="layui-input-inline" style="line-height: 25px;width:360px;">
					<input type="checkbox" name="viewtype" title="列表" value="list" lay-skin="primary" <#if tp.viewtype?? && tp.viewtype?index_of("list") gte 0>checked="checked"</#if>>
					<input type="checkbox" name="viewtype" title="新增" value="add" lay-skin="primary" <#if tp.viewtype?? && tp.viewtype?index_of("add") gte 0>checked="checked"</#if>> 
					<input type="checkbox" name="viewtype" title="修改" value="edit" lay-skin="primary" <#if tp.viewtype?? && tp.viewtype?index_of("edit") gte 0>checked="checked"</#if>>
					<input type="checkbox" name="viewtype" title="详细" value="detail" lay-skin="primary" <#if tp.viewtype?? && tp.viewtype?index_of("detail") gte 0>checked="checked"</#if>> 
				</div>
			</div>
		</div>
		<div class="layui-form-button">
			<div class="layui-button-block">
				<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>

<script>
//Demo
layui.use('form', function(){
  var form = layui.form;
  form.render(); //更新全部
  form.on("switch(dic)" , function(data){
  	if(data.elem.checked){
	  	$("#sysdicsel").show();
  	}else{
  		$("#sysdicsel").hide();
  	}
  });
  form.on("switch(fk)" , function(data){
  	if(data.elem.checked){
	  	$("#fk").show();
  	}else{
  		$("#fk").hide();
  	}
  });
  form.on("switch(phonenum)" , function(data){
	  	if(data.elem.checked){
		  	$("#phontype_sel").show();
	  	}else{
	  		$("#phontype_sel").hide();
	  	}
	  });
});
</script>